{include file="public/head"}
<link rel="stylesheet" href="__module__/flag-icon-css/css/flag-icon.css">
<style>
    .x-body {
        min-width: 1400px;
    }

    body {
        overflow-x: scroll;
    }
</style>
<body>
<div class="x-body">
    <div class="lotus-nav">

        <div class="layui-input-inline">
            <input id="order_no" name="order_no" class="layui-input" placeholder="订单编号" value="{$Think.get.order_no}">
        </div>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="start" name="start" value="{$Think.get.start}"
                   placeholder="开始日期">
        </div>

        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="end" name="end" value="{$Think.get.end}" placeholder="结束日期">
        </div>
        <button class="layui-btn layui-btn-sm" onclick="search()"><i class="layui-icon layui-icon-search"></i>搜索
        </button>
        <span class="x-right">共有数据:<i class="i_count">{$orders->total()}</i>条
            <button onclick="javascript:location.reload()" class="layui-btn-default ">
                <i class="layui-icon layui-icon-refresh"></i>
            </button>
        </span>

    </div>
    <table class="layui-table">
        <thead>
        <tr>
            <th style="width: 80px;text-align:center">系统编号</th>
            <th style="width: 80px;text-align:center">国家</th>
            <th style="width: 100px;text-align:center">商品图</th>
            <th style="min-width: 150px">亚马逊订单编号</th>
            <th style="width: 110px;text-align:center">实付价格</th>
            <th style="width: 130px;text-align:center">购买商品数量</th>
            <th style="width: 60px;text-align:center">状态</th>
            <th style="width: 130px;text-align:center">订单时间</th>
            <th style="width: 75px;text-align:center">操作</th>
        </thead>
        <tbody>

        {volist name="orders" id="vo"}
        <tr>
            <td style="text-align:center">{$vo.id}</td>
            <td style="text-align:center">
                <span class="label label-default">
                    <span class="flag-icon flag-icon-{php}echo strtolower($store[$vo['shop_id']]['nation_short']){/php}"></span>
                    {$store[$vo['shop_id']]['nation']}
                </span>
            </td>
            <td style="max-height: 100px;text-align:center">
                {if isset($product[$vo['id']]['url'])}
                <img src="{$product[$vo['id']]['url']}" onclick="previewImg(this)">
                {else/}
                <img src="__images__/noimg.png">
                {/if}
            </td>
            <td>{$vo.order_no}</td>
            <td style="text-align:center">{$vo.pay_money}{$vo.coin}</td>
            <td style="text-align:center">{$vo.goods_num}</td>
            <td style="text-align:center">{$order_status[$vo.order_status]|default=''}</td>
            <td style="text-align:center">{$vo['create_time']|date="Y-m-d H:i",###}</td>
            <td style="text-align:center">
                <button class="layui-btn layui-btn-xs"
                        onclick="x_admin_show('订单详情','amazonInfoDelivery.html?id={$vo.id}')">详情
                </button>
            </td>
        </tr>
        {/volist}

        </tbody>
    </table>
    <div class="page">
        <div>
            {$orders->render()}
        </div>
    </div>
</div>
</body>
{include file="public/foot"}
<script>
    function search() {
        var order_no = $("#order_no").val();
        var start = $("#start").val();
        var end = $("#end").val();
        location.href = "amazonDelivery.html?order_no=" + order_no + "&start=" + start + "&end=" + end;
    }

    layui.use(['laydate', 'form'], function () {
        var laydate = layui.laydate;
        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });
        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });
</script>
